package com.qn.example.mapper;

import com.qn.example.pojo.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 21276
 * @version 1.0
 * @date 2023/5/10 17:16
 */
public interface DishFlavorMapper {
    void batchSave(@Param("flavors")List<DishFlavor> flavors);

    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> findByDishId(Long id);

    // 根据菜品的id删除口味信息
    @Delete("delete from dish_flavor where dish_id=#{id}")
    void deleteByDishId(Long id);

    //多个菜品id，删除对应的菜品口味信息
    void deleteByDishIds(@Param("ids") List<Long> ids);
}
